<template>
  <a-radio-group v-model="myValue" @change="onChange">
    <a-radio v-for="item in dataList" :key="item.key" :value="item.key"> {{ item.name }} </a-radio>
  </a-radio-group>
</template>
<script>
export default {
  props: {
    dataList: {
      type: Array,
      default: () => [
        { key: true, name: '是' },
        { key: false, name: '否' },
      ],
    },
    // 绑定字段名称
    field: {
      type: String,
      require: true,
    },
    value: {},
    // 绑定字段父级属性
    f_field: {
      type: String,
      require: true,
    },
    // 绑定字段父级属性
    index: {
      type: Number
    },
  },
  data() {
    return {
      myValue: this.value,
    }
  },
  methods: {
    onChange(e) {
      this.myValue = e.target.value
      this.$emit('f_setYesNo', this.myValue, this.field, this.f_field, this.index)
    },
  },
}
</script>

<style lang="scss" scoped>
</style>
